import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * roles: ['admin', 'common']       // 访问路由的角色权限
 * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
 * meta : {
    noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
    icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
    breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
  }
 */

// 公共路由
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },
  {
    path: '/register',
    component: () => import('@/views/register'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/error/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/error/401'),
    hidden: true
  },
  {
    path: '',
    component: Layout,
    redirect: 'index',
    children: [
      {
        path: 'index',
        component: () => import('@/views/index'),
        name: 'Index',
        meta: { title: '首页', icon: 'dashboard', affix: true }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    hidden: true,
    redirect: 'noredirect',
    children: [
      {
        path: 'profile',
        component: () => import('@/views/system/user/profile/index'),
        name: 'Profile',
        meta: { title: '个人中心', icon: 'user' }
      }
    ]
  }
]

// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [
  {
    path: '/system/user-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:user:edit'],
    children: [
      {
        path: 'role/:userId(\\d+)',
        component: () => import('@/views/system/user/authRole'),
        // component: (res) => require(['@/views/system/user/authRole'],res),
        name: 'AuthRole',
        meta: { title: '分配角色', activeMenu: '/system/user' }
      }
    ]
  },
  {
    path: '/system/role-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:role:edit'],
    children: [
      {
        path: 'user/:roleId(\\d+)',
        component: () => import('@/views/system/role/authUser'),
        name: 'AuthUser',
        meta: { title: '分配用户', activeMenu: '/system/role' }
      }
    ]
  },
  {
    path: '/system/dict-data',
    component: Layout,
    hidden: true,
    permissions: ['system:dict:list'],
    children: [
      {
        path: 'index/:dictId(\\d+)',
        component: () => import('@/views/system/dict/data'),
        name: 'Data',
        meta: { title: '字典数据', activeMenu: '/system/dict' }
      }
    ]
  },
  {
    path: '/monitor/job-log',
    component: Layout,
    hidden: true,
    permissions: ['monitor:job:list'],
    children: [
      {
        path: 'index/:jobId(\\d+)',
        component: () => import('@/views/monitor/job/log'),
        name: 'JobLog',
        meta: { title: '调度日志', activeMenu: '/monitor/job' }
      }
    ]
  },
  {
    path: '/tool/gen-edit',
    component: Layout,
    hidden: true,
    permissions: ['tool:gen:edit'],
    children: [
      {
        path: 'index/:tableId(\\d+)',
        component: () => import('@/views/tool/gen/editTable'),
        name: 'GenEdit',
        meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
      }
    ]
  },
  
   /* {
              "name": "System",
              "path": "/system",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "系统管理",
                  "icon": "system",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "User",
                      "path": "user",
                      "hidden": false,
                      "component": "system/user/index",
                      "meta": {
                          "title": "用户管理",
                          "icon": "user",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Role",
                      "path": "role",
                      "hidden": false,
                      "component": "system/role/index",
                      "meta": {
                          "title": "角色管理",
                          "icon": "peoples",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Menu",
                      "path": "menu",
                      "hidden": false,
                      "component": "system/menu/index",
                      "meta": {
                          "title": "菜单管理",
                          "icon": "tree-table",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Dept",
                      "path": "dept",
                      "hidden": false,
                      "component": "system/dept/index",
                      "meta": {
                          "title": "部门管理",
                          "icon": "tree",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Post",
                      "path": "post",
                      "hidden": false,
                      "component": "system/post/index",
                      "meta": {
                          "title": "岗位管理",
                          "icon": "post",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Dict",
                      "path": "dict",
                      "hidden": false,
                      "component": "system/dict/index",
                      "meta": {
                          "title": "字典管理",
                          "icon": "dict",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Config",
                      "path": "config",
                      "hidden": false,
                      "component": "system/config/index",
                      "meta": {
                          "title": "参数设置",
                          "icon": "edit",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Notice",
                      "path": "notice",
                      "hidden": false,
                      "component": "system/notice/index",
                      "meta": {
                          "title": "通知公告",
                          "icon": "message",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Log",
                      "path": "log",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "日志管理",
                          "icon": "log",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Operlog",
                              "path": "operlog",
                              "hidden": false,
                              "component": "system/operlog/index",
                              "meta": {
                                  "title": "操作日志",
                                  "icon": "form",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Logininfor",
                              "path": "logininfor",
                              "hidden": false,
                              "component": "system/logininfor/index",
                              "meta": {
                                  "title": "登录日志",
                                  "icon": "logininfor",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  }
              ]
          }, */
		 
		
		
         /* {
              name: "Label",
              path: "/label",
              hidden: false,
              redirect: "noRedirect",
              component: Layout,
              alwaysShow: true,
              meta: {
                  title: "标签管理",
                  icon: "tab",
                  noCache: false,
                  link: null
              },
              children: [
                  {
                      name: "Subtr",
                      path: "subtr",
                      hidden: false,
                      component: () => import('@/views/gen/subtract/index'),
                      meta: {
                          title: "扣分标签",
                          icon: "rate",
                          noCache: false,
                          link: null
                      }
                  },
                  {
                      name: "Add",
                      path: "add",
                      hidden: false,
                      // component: "label/add/index",
                       component: () => import('@/views/gen/add/index'),
                      meta: {
                          title: "得分标签",
                          icon: "star",
                          noCache: false,
                          link: null
                      }
                  },
                  {
                      name: "AddOption",
                      path: "addOption",
                      hidden: false,
                      // component: "label/addOption/index",
					  component: () => import('@/views/gen/label/index'),
                      meta: {
                          title: "标签关系配置",
                          icon: "nested",
                          noCache: false,
                          link: null
                      }
                  }
              ]
          }, */
          /* {
              "name": "User",
              "path": "/user",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "会员管理",
                  "icon": "peoples",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "User",
                      "path": "user",
                      "hidden": false,
                      "component": "user/user/index",
                      "meta": {
                          "title": "会员管理",
                          "icon": "people",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Album",
                      "path": "album",
                      "hidden": false,
                      "component": "user/album/index",
                      "meta": {
                          "title": "会员相册",
                          "icon": "table",
                          "noCache": true,
                          "link": null
                      }
                  },
                  {
                      "name": "Scores",
                      "path": "scores",
                      "hidden": false,
                      "component": "user/scores/index",
                      "meta": {
                          "title": "信息评分",
                          "icon": "build",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Approve",
                      "path": "approve",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "认证管理",
                          "icon": "job",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "RealName",
                              "path": "realName",
                              "hidden": false,
                              "component": "user/approve/realName/index",
                              "meta": {
                                  "title": "会员实名认证",
                                  "icon": "people",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Education",
                              "path": "education",
                              "hidden": false,
                              "component": "user/approve/education/index",
                              "meta": {
                                  "title": "会员学历认证",
                                  "icon": "language",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Salary",
                              "path": "salary",
                              "hidden": false,
                              "component": "user/approve/salary/index",
                              "meta": {
                                  "title": "会员收入认证",
                                  "icon": "money",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Car",
                              "path": "car",
                              "hidden": false,
                              "component": "user/approve/car/index",
                              "meta": {
                                  "title": "会员车辆认证",
                                  "icon": "guide",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "House",
                              "path": "house",
                              "hidden": false,
                              "component": "user/approve/house/index",
                              "meta": {
                                  "title": "会员房屋认证",
                                  "icon": "excel",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Marriage",
                              "path": "marriage",
                              "hidden": false,
                              "component": "user/approve/marriage/index",
                              "meta": {
                                  "title": "会员婚姻认证",
                                  "icon": "peoples",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Score",
                      "path": "score",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "会员积分",
                          "icon": "log",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Index",
                              "path": "index",
                              "hidden": false,
                              "component": "user/score/index",
                              "meta": {
                                  "title": "积分变动管理",
                                  "icon": "job",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Order",
                      "path": "order",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "会员订单",
                          "icon": "form",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Index",
                              "path": "index",
                              "hidden": false,
                              "component": "user/order/index",
                              "meta": {
                                  "title": "订单管理",
                                  "icon": "server",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Basic",
                      "path": "basic",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "会员基础管理",
                          "icon": "number",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Edu",
                              "path": "edu",
                              "hidden": false,
                              "component": "user/basic/edu/index",
                              "meta": {
                                  "title": "学历设置",
                                  "icon": "lock",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Salary",
                              "path": "salary",
                              "hidden": false,
                              "component": "user/basic/salary/index",
                              "meta": {
                                  "title": "年薪设置",
                                  "icon": "email",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Job",
                              "path": "job",
                              "hidden": false,
                              "component": "user/basic/job/index",
                              "meta": {
                                  "title": "职业设置",
                                  "icon": "component",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Nation",
                              "path": "nation",
                              "hidden": false,
                              "component": "user/basic/nation/index",
                              "meta": {
                                  "title": "民族设置",
                                  "icon": "icon",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Constellation",
                              "path": "constellation",
                              "hidden": false,
                              "component": "user/basic/constellation/index",
                              "meta": {
                                  "title": "星座设置",
                                  "icon": "date-range",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Zodiac",
                              "path": "zodiac",
                              "hidden": false,
                              "component": "user/basic/zodiac/index",
                              "meta": {
                                  "title": "属相设置",
                                  "icon": "github",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "BloodType",
                              "path": "bloodType",
                              "hidden": false,
                              "component": "user/basic/bloodType/index",
                              "meta": {
                                  "title": "血型设置",
                                  "icon": "pdf",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "EduType",
                              "path": "eduType",
                              "hidden": false,
                              "component": "user/basic/eduType/index",
                              "meta": {
                                  "title": "院校性质设置",
                                  "icon": "textarea",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Ptt",
                      "path": "ptt",
                      "hidden": false,
                      "component": "user/ptt/index",
                      "meta": {
                          "title": "会员答题管理",
                          "icon": "education",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Bdt",
                      "path": "bdt",
                      "hidden": false,
                      "component": "user/bdt/index",
                      "meta": {
                          "title": "会员答题必答题",
                          "icon": "druid",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Attention",
                      "path": "attention",
                      "hidden": false,
                      "component": "user/attention/index",
                      "meta": {
                          "title": "会员关注",
                          "icon": "monitor",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Like",
                      "path": "like",
                      "hidden": false,
                      "component": "user/like/index",
                      "meta": {
                          "title": "会员喜欢",
                          "icon": "server",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Collect",
                      "path": "collect",
                      "hidden": false,
                      "component": "user/collect/index",
                      "meta": {
                          "title": "会员收藏",
                          "icon": "rate",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Look",
                      "path": "look",
                      "hidden": false,
                      "component": "user/look/index",
                      "meta": {
                          "title": "会员浏览",
                          "icon": "eye-open",
                          "noCache": false,
                          "link": null
                      }
                  }
              ]
          },
          {
              "name": "Meet",
              "path": "/meet",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "见面管理",
                  "icon": "time",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "Request",
                      "path": "request",
                      "hidden": false,
                      "component": "meet/request/index",
                      "meta": {
                          "title": "见面请求管理",
                          "icon": "time",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Appointment",
                      "path": "appointment",
                      "hidden": false,
                      "component": "meet/appointment/index",
                      "meta": {
                          "title": "约会管理",
                          "icon": "email",
                          "noCache": false,
                          "link": null
                      }
                  }
              ]
          },
          {
              "name": "Question",
              "path": "/question",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "题库管理",
                  "icon": "build",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "Setting",
                      "path": "setting",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "题库设置",
                          "icon": "server",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Type",
                              "path": "type",
                              "hidden": false,
                              "component": "question/type/index",
                              "meta": {
                                  "title": "题型管理",
                                  "icon": "excel",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Theme",
                              "path": "theme",
                              "hidden": false,
                              "component": "question/theme/index",
                              "meta": {
                                  "title": "主题管理",
                                  "icon": "theme",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Label",
                              "path": "label",
                              "hidden": false,
                              "component": "question/label/index",
                              "meta": {
                                  "title": "题库标签",
                                  "icon": "tab",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Category",
                              "path": "category",
                              "hidden": false,
                              "component": "question/category/index",
                              "meta": {
                                  "title": "题库分类",
                                  "icon": "cascader",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Ordinary",
                      "path": "ordinary",
                      "hidden": false,
                      "redirect": "noRedirect",
                      "component": "ParentView",
                      "alwaysShow": true,
                      "meta": {
                          "title": "普通题库",
                          "icon": "form",
                          "noCache": false,
                          "link": null
                      },
                      "children": [
                          {
                              "name": "Gt",
                              "path": "gt",
                              "hidden": false,
                              "component": "question/gt/index",
                              "meta": {
                                  "title": "共同题",
                                  "icon": "clipboard",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Ab",
                              "path": "ab",
                              "hidden": false,
                              "component": "question/ab/index",
                              "meta": {
                                  "title": "AB题",
                                  "icon": "language",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Zh",
                              "path": "zh",
                              "hidden": false,
                              "component": "question/zh/index",
                              "meta": {
                                  "title": "组合题",
                                  "icon": "example",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Md",
                              "path": "md",
                              "hidden": false,
                              "component": "question/md/index",
                              "meta": {
                                  "title": "矛盾题",
                                  "icon": "switch",
                                  "noCache": false,
                                  "link": null
                              }
                          },
                          {
                              "name": "Sgbz",
                              "path": "sgbz",
                              "hidden": false,
                              "component": "question/sgbz/index",
                              "meta": {
                                  "title": "三观不正题",
                                  "icon": "peoples",
                                  "noCache": false,
                                  "link": null
                              }
                          }
                      ]
                  },
                  {
                      "name": "Bd",
                      "path": "bd",
                      "hidden": false,
                      "component": "question/bd/index",
                      "meta": {
                          "title": "必答题",
                          "icon": "star",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Yxd",
                      "path": "yxd",
                      "hidden": false,
                      "component": "question/yxd/index",
                      "meta": {
                          "title": "优先答题",
                          "icon": "log",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Jd",
                      "path": "jd",
                      "hidden": false,
                      "component": "question/jd/index",
                      "meta": {
                          "title": "简单题",
                          "icon": "post",
                          "noCache": false,
                          "link": null
                      }
                  }
              ]
          },
          {
              "name": "Match",
              "path": "/match",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "匹配管理",
                  "icon": "cascader",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "Match",
                      "path": "match",
                      "hidden": false,
                      "component": "match/match/index",
                      "meta": {
                          "title": "匹配管理",
                          "icon": "time-range",
                          "noCache": false,
                          "link": null
                      }
                  }
              ]
          },
          {
              "name": "Marketing",
              "path": "/marketing",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "营销管理",
                  "icon": "shopping",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "Trust",
                      "path": "trust",
                      "hidden": false,
                      "component": "market/trust/index",
                      "meta": {
                          "title": "认证信任度套餐",
                          "icon": "input",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Coupon",
                      "path": "coupon",
                      "hidden": false,
                      "component": "market/coupon/index",
                      "meta": {
                          "title": "优惠券管理",
                          "icon": "money",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Point",
                      "path": "point",
                      "hidden": false,
                      "component": "market/point/index",
                      "meta": {
                          "title": "积分充值套餐管理",
                          "icon": "monitor",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Meet",
                      "path": "meet",
                      "hidden": false,
                      "component": "market/meet/index",
                      "meta": {
                          "title": "见面充值套餐管理",
                          "icon": "password",
                          "noCache": false,
                          "link": null
                      }
                  }
              ]
          }, */
          /* {
              "name": "Monitor",
              "path": "/monitor",
              "hidden": false,
              "redirect": "noRedirect",
              "component": "Layout",
              "alwaysShow": true,
              "meta": {
                  "title": "系统监控",
                  "icon": "monitor",
                  "noCache": false,
                  "link": null
              },
              "children": [
                  {
                      "name": "Online",
                      "path": "online",
                      "hidden": false,
                      "component": "monitor/online/index",
                      "meta": {
                          "title": "在线用户",
                          "icon": "online",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Job",
                      "path": "job",
                      "hidden": false,
                      "component": "monitor/job/index",
                      "meta": {
                          "title": "定时任务",
                          "icon": "job",
                          "noCache": false,
                          "link": null
                      }
                  },
                  {
                      "name": "Http://localhost:8718",
                      "path": "http://localhost:8718",
                      "hidden": false,
                      "component": "Layout",
                      "meta": {
                          "title": "Sentinel控制台",
                          "icon": "sentinel",
                          "noCache": false,
                          "link": "http://localhost:8718"
                      }
                  },
                  {
                      "name": "Http://localhost:8848/nacos",
                      "path": "http://localhost:8848/nacos",
                      "hidden": false,
                      "component": "Layout",
                      "meta": {
                          "title": "Nacos控制台",
                          "icon": "nacos",
                          "noCache": false,
                          "link": "http://localhost:8848/nacos"
                      }
                  },
                  {
                      "name": "Http://localhost:9100/login",
                      "path": "http://localhost:9100/login",
                      "hidden": false,
                      "component": "Layout",
                      "meta": {
                          "title": "Admin控制台",
                          "icon": "server",
                          "noCache": false,
                          "link": "http://localhost:9100/login"
                      }
                  }
              ]
          } */
  
]

// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace;
// push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(err => err)
}
// replace
Router.prototype.replace = function push(location) {
  return routerReplace.call(this, location).catch(err => err)
}

export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
